package com.sales.service.impl;

import com.sales.dao.QuotationDetMapper;
import com.sales.service.QuotationDetService;
import org.comple.erp.pojo.sales.QuotationDet;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional(rollbackFor = RuntimeException.class)
public class QuotationDetServiceImpl implements QuotationDetService {
    @Autowired
    private QuotationDetMapper quotationDetMapper;

    @Override
    public Boolean insertSelective(QuotationDet quotationDet) {
         if(quotationDetMapper.insertSelective(quotationDet)>0){
             return true;
         }
        return false;
    }

    @Override
    public List<QuotationDet> selectByQuotationCode(String code) {
        return quotationDetMapper.selectByQuotationCode(code);
    }

    @Override
    public Boolean updateByPrimaryKeySelective(QuotationDet quotationDet) {
        if(quotationDetMapper.updateByPrimaryKeySelective(quotationDet) > 0){
            return true;
        }
        return false;
    }

    @Override
    public Boolean deleteByCode(String quotation_code) {
        if(quotationDetMapper.deleteByCode(quotation_code) > 0){
            return true;
        }
        return false;
    }

    @Override
    public Boolean deleteByCodeLj(String quotation_code) {
        if(quotationDetMapper.deleteByCodeLj(quotation_code)>0){
            return true;
        }
        return false;
    }



}
